<?php

include("webphrame/webphrame.php");

$webphrame->setPageTitle("Home");
$webphrame->head();

if(isset($_GET['login']))
	if($webphrame->auth->logIn($_POST['name'], $_POST['password']))
		echo "Congratulations, you have logged in successfully.<br><br>\n";
	else
		echo "Sorry, login failed.<br><br>\n";

if(isset($_GET['logout']))
	$webphrame->auth->logOut();

?>

Welcome to the WebPhrame default page.<br><br>

<?php

if($webphrame->auth->isLoggedIn()) {
	echo "You are presently logged in as <i>".$webphrame->auth->name."</i>.<br><br>\n";
	echo "Click <a href=\"?logout\">here</a> to log out.<br><br>\n";
} else {

	?>

	You are not presently logged in. You may log in below.<br><br>

	<form method="POST" action="index.php?login">
		Username: <input name="name" type="text" size="30"><br>
		Password: <input name="password" type="password" size="30"><br>
		<input type="submit" value="Log In">
	</form>

	<?php

}

$webphrame->foot();

?>
